<?php

namespace Database\Factories;

use App\Models\StoreBargain;
use Illuminate\Database\Eloquent\Factories\Factory;

class StoreBargainFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = StoreBargain::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'product_id' => $this->faker->numberBetween(1, 2),
            'bargain_user_id' => $this->faker->numberBetween(1, 2),
            'shop_id' => $this->faker->numberBetween(1, 2),
            'title' => $this->faker->text(20),
            'pic' => "http://placeimg.com/400/400/any",
            'store_name' => $this->faker->text(20),
            'rotation_chart' => ['http://placeimg.com/400/400/any','http://placeimg.com/400/400/any','http://placeimg.com/400/400/any'],
            'unit_name' => '件',
            'price' => $this->faker->randomFloat(2, 1, 50),
            'min_price' => $this->faker->randomFloat(2, 0, 50),
            'bargain_max_price' => $this->faker->randomFloat(2, 45, 50),
            'bargain_min_price' => $this->faker->randomFloat(2, 1, 10),
            'start_at' => date('Y-m-d H:i:s',$this->faker->numberBetween(1500000000, 1601000000)),
            'stop_at' => date('Y-m-d H:i:s',$this->faker->numberBetween(1601000000, time())),
            'desc' => $this->faker->text(20),
            'introduction' => $this->faker->text(20),
            'temp_id' => $this->faker->numberBetween(0, 50),
            'rule' => $this->faker->text(20),
            'stock' => $this->faker->numberBetween(50, 200),
            'sales' => $this->faker->numberBetween(50, 200),
            'give_integral' => $this->faker->randomFloat(2, 1, 10),
            'num' => $this->faker->numberBetween(10, 100),
            'sort' => $this->faker->numberBetween(0, 100),
            'look' => $this->faker->numberBetween(50, 200),
            'share' => $this->faker->numberBetween(50, 200),
            'quota' => $this->faker->numberBetween(10, 20),
            'quota_show' => $this->faker->numberBetween(0, 1),
            'people_num' => $this->faker->numberBetween(1, 50),
            'weight' => $this->faker->numberBetween(20, 200),
            'volume' => $this->faker->numberBetween(20, 200),
            'postage' => $this->faker->randomFloat(2, 0, 50),
            'cost_price' => $this->faker->randomFloat(2, 0, 50),
            'participants' => $this->faker->numberBetween(50, 200),
            'buyers' => $this->faker->numberBetween(10, 50),
            'is_recommend' => $this->faker->numberBetween(0, 1),
            'is_postage' => $this->faker->numberBetween(0, 1),
            'status' => $this->faker->numberBetween(0, 1),
        ];
    }
}
